let str = '2020-12-30~2021-01-3';
let temp = str.split("~");
let startTime = Date.parse(temp[0]);
let endTime = Date.parse(temp[1]);

let res = [];
//计算时间差
for (let i = startTime; i <= endTime; i = i + 24 * 60 * 60 * 1000) {
    let date = new Date(i);
    res.push(`${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`);
}

console.log(res);